package com.example.myandroidapp;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

public class PersonDetail extends Activity
{
    private static final String TAG = "PersonDetail";

    private ImageView imageViewPerson;

    private TextView textviewnumber;

    private TextView textviewage;

    private TextView textviewname;

    private Button saveButton;
    
    private EditText editAgeField;

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_person_detail);

        imageViewPerson = (ImageView) this.findViewById(R.id.imageViewPerson);

        textviewname = (TextView) this.findViewById(R.id.textviewname);

        textviewage = (TextView) this.findViewById(R.id.textviewage);

        textviewnumber = (TextView) this.findViewById(R.id.textviewnumber);

        saveButton = (Button) this.findViewById(R.id.savebutton);
        
        editAgeField = (EditText) this.findViewById(R.id.editAgeField);

        Bundle extras = getIntent().getExtras();
        if (extras != null)
        {
            Log.d(TAG, "Let's get the values");
            String name = extras.getString("name");
            int age = extras.getInt("age");
            int number = extras.getInt("number");
            Log.d(TAG, "name = " + age + " age= " + "number=" + number);

            textviewname.setText(name);

            editAgeField.setText(age);
            // textviewage.setText(Integer.valueOf(age));

            // textviewnumber.setText(number);

        }

        saveButton.setOnClickListener(new View.OnClickListener()
        {

            public void onClick(View v)
            {
                // TODO Auto-generated method stub
                finish();

            }
        });
    }

    @Override
    public void onPause()
    {
        super.onPause();

        Log.d(TAG, "----Yes, the onPause was called");
    }

    @Override
    public void onStop()
    {
        super.onStop();

        Log.d(TAG, "----Yes, the onStop was called");
    }

}
